
//以下代码只适合 nodejs 因为js 没有 buffer 对象
export function BufferToBase64(buffer){
    return	buffer.toString('base64')
  }
export function Base64ToBuffer(base64Str){
   return Buffer.from(base64Str,'base64')
}  

export function BufferToUtf8(buffer){
    return	buffer.toString('utf-8')
  }
export function Utf8ToBuffer(str){
   return Buffer.from(str)
}  


function stringToBase64(str){
    var base64Str = Buffer.from(str).toString('base64');
    return base64Str;
}
function base64ToString(base64Str){
    var str = Buffer.from(base64Str,'base64').toString();
    return str;
}
